package com.totem.base.enums;

import lombok.Getter;

import java.util.Objects;

@Getter
public enum OperateTypeEnum {
    MANUAL("MANUAL"), // 投入
    AUTO("AUTO"), // 自动复投
    WITHDRAW("WITHDRAW"), // 提取
    RETURN("RETURN"); // 收益

    private final String code;

    OperateTypeEnum(String code){
        this.code = code;
    }

    public static OperateTypeEnum byCode(String code) {
        for (OperateTypeEnum e: OperateTypeEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }
}
